home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / cpphtp2 / code.jar / code / ch11 / fig11_25.txt < prev    next >
Text File  |  1998-02-27  |  405b  |  17 lines

  1. 1   // Fig. 11.25: fig11_25.cpp 
  2. 2   // Using the ios::showbase flag
  3. 3   #include <iostream.h>
  4. 4   #include <iomanip.h>
  5. 5   
  6. 6   int main()
  7. 7   {
  8. 8      int x = 100;
  9. 9   
  10. 10     cout << setiosflags( ios::showbase )
  11. 11          << "Printing integers preceded by their base:\n"
  12. 12          << x << '\n'
  13. 13          << oct << x << '\n'
  14. 14          << hex << x << endl;
  15. 15     return 0;
  16. 16  }
  17.